package com.javastudy.jdkfeature.jdk7.collections;

import java.util.*;

public class Collections {
    public static void main(String[] args){

    }

    private static void beforeJDK7(){
        List<String> list = new ArrayList<String>();
        list.add("item");
        String item = list.get(0);

        Set<String> set = new HashSet<String>();
        set.add("item");
        Map<String, Integer> map = new HashMap<String, Integer>();
        map.put("key", 1);
        int value = map.get("key");
    }

    /**
     * 下面的语法无法通过编译
     */
    private static void jdk7(){
//        List<String> list = new ArrayList<>["item"];
//        String item = list[0];
//
//        Set<String> set = {"item"};
//
//        Map<String, Integer> map = {"key" : 1};
//        int value = map["key"];
    }
}
